import { SettingOutlined } from '@ant-design/icons';
import { maximize, minimize } from '@ui/utils/electron';
import { ipcRenderer } from 'electron';
import React from 'react';
import SetModal from '../setModal'
import './index.css';

class Header extends React.Component {
  state = {
    visible: false
  };

  componentDidMount() { }

  onAppClose = async () => {
    ipcRenderer.send('app-close');
  };

  render() {
    return (
      <div className="header">
        <SetModal visible={this.state.visible} close={() => {
          this.setState({
            visible: false
          })
        }} />
        <div className="app-title">王总爱心跑马灯</div>
        <div className="container"></div>
        <div className="right">
          <div className="btns">
            <SettingOutlined className='set' onClick={() => {
              this.setState({
                visible: !this.state.visible
              })
            }} />
            <div className="icon min" onClick={minimize}></div>
            {/* <div className="icon max" onClick={maximize}></div> */}
            <div className="icon close" onClick={this.onAppClose}></div>
          </div>
        </div>
      </div>
    );
  }
}

export default Header;
